package com.zoffy.ybuhelper.adapter;

import androidx.annotation.NonNull;
import com.zoffy.ybuhelper.R;
import com.zoffy.ybuhelper.pojo.entity.Eat;
import org.jetbrains.annotations.NotNull;

import java.util.List;

public class EatRecyclerAdapter extends ItemControlRecyclerAdapter {
    public EatRecyclerAdapter(List<Eat> dataList) {
        super(dataList);
    }

    @Override
    protected void setItemData(@NonNull @NotNull ControlViewHolder holder, int position) {
        Eat eat = (Eat) dataList.get(position);
        holder.informationTextView.setText(eat.getOriginName());
        if(eat.getOriginName() !=null){
            holder.nameTextView.setText(eat.getMenuName());
        }
        if(eat.getMenuDeleted()==0){
            holder.deletedTextView.setText("启用");
            holder.deletedTextView.setBackgroundResource(R.color.green);
        }
        else {
            holder.deletedTextView.setText("禁用");
            holder.deletedTextView.setBackgroundResource(R.color.red);
        }

    }
}
